function getLongestWord(sentence) {
  let longestWord = '';
  for (let word of sentence.split(" ")) {
    word = word.replace(".", "");
    longestWord = word.length > longestWord.length? word: longestWord;
  }
  return longestWord;
}

console.log(getLongestWord("Coding challenges are fun and educational."));